#ifndef _MODULE_H
#define _MODULE_H

#include <string>
#include "http.h"
class Server;

class Module
{
public:

  virtual ~Module()
  {
  }

  virtual std::string GetName() const
  {
    return std::string();
  }

  virtual Http ProcessRequest(const Http& request)
  {
    return Http(Http::Response::NotFound);
  }

protected:
  friend class Server;

  void SetServer(Server* server_)
  {
    server = server_;
  }

  virtual void OnAttachedToServer() 
  {
  };

  Server* server;
};

#endif//_MODULE_H
